import os
def compute_score():
    scores = []
    input_path = os.path.join(os.getcwd(), "student_grade_input.txt")
    with open(input_path, encoding='utf-8') as fin: 
        for line in fin:
#把最后的换行符去掉
            line =  line.strip()
#以逗号来分隔 
            fields = line.split(",")
            scores.append(int(fields[-1]))
    max_score = max(scores)
    min_score = min(scores)
    avg_score =round(sum(scores) / len(scores), 2)
    return max_score, min_score, avg_score

max_score, min_score, avg_score = compute_score()
print(f"max_score = {max_score}, min_score={min_score}, avg_score={avg_score}")